<?php


namespace App\Remote\Rms;

use GuzzleHttp\Exception\GuzzleException;
use Symfony\Component\HttpFoundation\Request as RequestAlias;

class RmsExportRemote extends BaseRmsRemote
{


    /**
     * 导出处理-创建
     *
     * @param int $fileType
     * @param string $name
     * @param array $params
     * @param int $createdByUid
     * @return mixed|void
     * @throws GuzzleException
     */
    public static function exportAdd(int $fileType, string $name, array $params, int $createdByUid)
    {
        return self::customCacheRequest(
            "api/internal/export/add",
            RequestAlias::METHOD_POST,
            ["fileType" => $fileType, 'name' => $name, 'params' => $params, 'createdByUid' => $createdByUid]
        );
    }


    /**
     * 导出处理-完成
     *
     * @param int $id
     * @param string $path
     * @return mixed|void
     * @throws GuzzleException
     */
    public static function exportFinish(int $id, string $path)
    {
        return self::customCacheRequest(
            "api/internal/export/finish",
            RequestAlias::METHOD_POST,
            ["id" => $id, 'path' => $path]
        );
    }

}
